Chris Pollett > Old Classes > CS174
( Print View )

Student Corner:
  [Submit Sec1]
  [Grades Sec1]

  [
Lecture Notes]
  [Discussion Board]

Course Info:
  [Texts & Links]
  [Description]
  [Course Outcomes]
  [Outcomes Matrix]
  [Course Schedule]
  [Grading]
  [Requirements/HW/Quizzes]
  [Class Protocols]
  [Exam Info]
  [Regrades]
  [University Policies]
  [Announcements]

HW Assignments:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]  [Quizzes]

Practice Exams:
  [Midterm]  [Final]

                           












CS174 Spring 2017Practice Midterm

Studying for one of my tests does involve some memorization. I believe this is an important skill. Often people waste a lot of time and fail to remember the things they are trying to memorize. Please use a technique that has been shown to work such as the method of loci. Other memorization techniques can be found off the Wiki Page for Moonwalking with Einstein. Given this, to study for the midterm, I suggest you:

  • Know how to do (by heart) all the practice problems.
  • Go over your notes at least three times. Second and third time try to see how much you can remember from the first time.
  • Go over the homework problems.
  • Try to create your own problems similar to the ones I have given and solve them.
  • If you want to study in groups, at this point you are ready to quiz each other.

The practice midterm is below. Here are some facts about the actual midterm: (a) It is closed book, closed notes. Nothing will be permitted on your desk except your pen (pencil) and test. (b) You should bring photo ID. (c) There will be more than one version of the test. Each version will be of comparable difficulty. (d) One problem (less typos) on the actual test will be from the practice test.

  1. Define these terms: (a) Fully qualified domain name. (b) World Wide Web. (c) Server Root. (d) Document Root.
  2. Give an example of a minimal HTTP 1.1 get request. Explain what it would do.
  3. Write a validating XHTML 5 document that: (a) makes use of the external stylesheet styles.css from the same folder, (b) tells robots not to follow outgoing links from the page, (c) has an h1 tag with name matching its title, and (d) has an unordered list on it.
  4. Give the XHTML 5 necessary to output an accessible form form with a dropdown that lets users select the month of the year. Give the css to style any label for this tag so it appears in a 14pt font.
  5. Briefly explain the box model used in rendering HTML elements, labeling its parts.
  6. Write a PHP program that (a) check if the request had a variable rows with value some integer, and if so calls a function drawSquareTable with this value (b) drawSquareTable($num) draws an WAI accessible table that has two columns with heading n and n2, (c) drawSquareTable($num) then draws under these headings $num rows: 1, 1; 2,4; 3, 9; ... , (d) if the row's request variable is not set, your program should say "To see a tables add a query string containing a rows variable" and then exit.
  7. Describe the HTTP cookie protocol for setting/returning cookies. Explain how it can be used to implement sessions.
  8. Write a short PHP script which (a) connects to the database SJSU_COURSE, (b) uses a prepared statement to query MIDTERM_QUESTIONS table the twice to return once where the CLASS column has value CS174, once where it has value CS254, (c) and for each query, it outputs in a table all columns of all matching rows.
  9. Briefly explain the Post-Redirect-Get pattern.
  10. What is class autoloading in PHP and give a briefly example of how to set it up and how it works.